﻿using Microsoft.AspNetCore.Mvc;

namespace WebApplication1.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    [Consumes("application/json")]
    public class ConsumesController : ControllerBase
    {
        [HttpPost]
        //[Route("model")]
        public IActionResult PostJson(DateModel1 model)
        {
            return new JsonResult(model);
        }

        [HttpPost]
        [Route("name")]
        public IActionResult PostString(string name)
        {
            return new JsonResult(name);
        }
    }

    public class DateModel1
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
}
